<?php

class PageLayout {
	//class variables
	private $title = 'EventDB';

	//header
	public function header() {
		//begin header HTML
		echo "<!DOCTYPE HTML>\n";
		echo '<html lang="en">' . "\n\n";
		echo "<head>\n";
		echo '  <meta charset="utf-8">' . "\n";
		echo "  <title>$this->title</title>\n";
		echo '  <link rel="stylesheet" href="./css/style.css" type="text/css" media="screen" />' . "\n";
		//make HTML5 elements work in IE9
		echo "  <!--[if lt IE 9]>\n";
		echo '    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>' . "\n";
		echo "  <![endif]-->\n";
		echo "</head>\n\n";
	}

	//body (scope determines public view or private view)
	public function body($scope) {
		//begin body HTML
		echo "<body>\n";
		//logo and header graphic here
		echo "  <header>\n";
		echo '    <img src="./gems.png" width="325" height="90" alt="G.E.M.S." />' . "\n";
		echo "  </header>\n";
		echo "  <nav>\n";
		//menu here (output based on user level)
		if ($scope == 'public') {
			//public menu here
			echo "    <ul>\n";
			echo '      <li><a href="./testPage.php">HOME</a></li>' . "\n";
			echo '      <li><a href="#">SERVICES</a></li>' . "\n";
			echo '      <li><a href="#">ATTENDEES</a></li>' . "\n";
			echo '      <li><a href="#">PLANNERS</a></li>' . "\n";
			echo '      <li><a href="#">POLICIES</a></li>' . "\n";
			echo '      <li><a href="#">Q & A</a></li>' . "\n";
			echo '      <li><a href="#">CONTACT</a></li>' . "\n";
			echo "    </ul>\n";
		} else if ($scope == 'private') {
			//private menu here
			echo "    <ul>\n";
			echo '      <li><a href="./testPage2.php">HOME</a></li>' . "\n";
			echo '      <li><a href="./addEventPage.php">ADD EVENT</a></li>' . "\n";
			echo '      <li><a href="#">ATTENDEES</a></li>' . "\n";
			echo '      <li><a href="#">PLANNERS</a></li>' . "\n";
			echo '      <li><a href="#">POLICIES</a></li>' . "\n";
			echo '      <li><a href="#">Q & A</a></li>' . "\n";
			echo '      <li><a href="#">CONTACT</a></li>' . "\n";
			echo "    </ul>\n";
		} else {
			//update calling page because arg should be public or private
		}
		echo "  </nav>\n";
		//start main content
		echo '  <div id="mainArea">' . "\n";
		echo '    <div id="content">' . "\n";
	}

	//footer
	public function footer() {
		//end main content
		echo "    </div>\n";
		echo '    <div class="clear"></div>' . "\n";
		echo "  </div>\n";
		//date variables
		date_default_timezone_set('America/Chicago');
		$creationDate = 2012;
		$currentDate = date('Y');
		//begin footer HTML
		echo "  <footer>\n";
		echo "    <ul>\n";
		//kudos
		echo '      <li>Site Developed By: <a href="http://www.olemiss.edu" target="_blank">Students of The University of Mississippi</a> | <a href="http://www.olemissbusiness.com/AcademicPrograms/Undergraduate/Majors/MIS.html" target="_blank">MIS419</a> | Spring | 2012</li>' . "\n";
		//copyright info
		echo '      <li>Copyright &copy; ';
		if ($currentDate == $creationDate) {
			echo "$creationDate</li>\n";
		} else {
			echo "$creationDate - $currentDate</li>\n";
		}
		echo "    </ul>\n";
		echo "  </footer>\n";
		//close body HTML
		echo "</body>\n\n";
		echo "</html>\n";
	}

}

?>